package cn.qzit.frame;

import cn.qzit.menu.MineMenuBar;
import cn.qzit.panel.MineField;
import cn.qzit.panel.MineState;

import javax.swing.*;
import java.awt.*;

/**
 * ClassName : cn.qzit.frame.StartFrame
 * Desc : TESTss   ss
 *
 * @author : LINPQ
 * @date : 2022/4/13 14:41
 */
public class StartFrame extends JFrame {

    private MineMenuBar mineMenuBar;
    private MineState mineState;
    private MineField mineField;

    public StartFrame(){
        //标题
        this.setTitle("骚雷2022weism");
        //位置
        this.setLocation(500,500);

        this.setLayout(new BorderLayout());

        init();

//        this.setSize(300,300);
        //设置关闭
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        //设置图标
        this.setIconImage(new ImageIcon("./picture/icon.gif").getImage());
        //可见
        this.setVisible(true);
        //自适应
        this.pack();
        //限制大小
//        this.setResizable(false);
        //设置颜色
//        this.setBackground(new Color(255,200,66));
    }

    /**
     * 初始化菜单栏、状态栏、雷区，并加入到主窗口
     */
    public void init(){

        mineMenuBar = new MineMenuBar();
        this.setJMenuBar(mineMenuBar);

        mineState = new MineState();
        this.add(mineState,BorderLayout.NORTH);

        mineField = new MineField();
        this.add(mineField);
    }

    public static void main(String[] args) {
        new StartFrame();
    }
}
